Skip to content

List every node --test input in the CI guard - #3441

Merged
Birfy merged 1 commit into
mainfrom
dev/3440-ci-ls-guard-all-inputs
Nov 29, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3440-ci-ls-guard-all-inputs

Conversation

@Birfy

@Birfy Birfy commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Related #3440

What this changes

.github/workflows/tests.yml runs three node --test inputs in one step, but its ls guard
covers only .github/scripts/*.test.mjs. node --test exits 0 with zero tests when a pattern
matches no file (measured on v22.23.5; the workflow comment records the same for Node 24.22), so
a rename or move of tests/ or of the compose planner file would leave this step green with
missing coverage.

Two files, +27/−7:

  • .github/workflows/tests.yml (+6/−3): the step becomes a block scalar — one ls listing all
    three inputs, then the same node --test invocation as before.
  • tests/ci_test_list.test.mjs (+21/−4): the literal whole-line assertion is replaced by a
    structural one. The block must hold an ls line and a node --test line, the ls must come
    first, and the argument sets of the two lines must be exactly equal (sorted deepEqual: listing
    order is free, membership is not). The assertion is bidirectional on purpose — a one-way
    "everything on the run line is guarded" check still passes when an input is deleted from the run
    line, which is the silent-coverage-loss case this PR is about.

The test invocation itself is unchanged: same three inputs, same order, same Node version (22,
tests.yml:26). Only the guarding around it changes.

Verification (local, not CI)

Host: this machine, node v22.23.5, TMPDIR on disk. Baseline for the comparison is main
ee8ae6df3e3ee10af8cad63e5e7e078db4fc9bd8, tree dffcaed5782aedb4f710695d9d06af9bd5d2e93e; the
patch was git apply --checked against that exact tree (exit 0).

  1. The step body still passes. Running the patched block body verbatim under bash -e:
    # tests 1117 / # pass 1117 / # fail 0 / # cancelled 0, exit 0. One run, one host — the
    tests/ds_bot_bridge.test.mjs timing case is known to flake under load (a second host saw
    1116/1 once), so this number is a single local reading, not a stability claim.

  2. The guard fires. With tests/ renamed away, the ls reports
    cannot access 'tests/*.test.mjs', step exit 2, and the run line never executes.

  3. The new assertion is not fail-open. Four edits of the patched workflow each turn
    tests/ci_test_list.test.mjs red:

    mutation result
    node --test moved above the ls red — the ls guard must come before node --test
    unlisted input appended to the run line red — the ls guard must list exactly the inputs on the node --test line (+ visible diff)
    ls line deleted red — the block must hold an ls guard and a node --test line
    one input deleted from the run line only red — the ls guard must list exactly the inputs on the node --test line (+ visible diff)
    none (clean patched tree) 2/2 pass

    The last mutation is the one that made the earlier drafts wrong, twice: the first draft compared
    the block's first line with itself and stayed green when the ls was moved or removed; the
    second compared argument sets one way only and stayed green when tests/*.test.mjs was dropped
    from the run line — that variant still ran 150/150 pass, exit 0 in the step body while 967 web
    tests had silently disappeared. Both gaps are shut here; the coverage loss now fails the workflow.

  4. No actionlint. actionlint is not installed on this host and the repository has no workflow
    syntax job, so the YAML side is backed by parsing the file plus executing the block body under
    bash -e, not by a linter. A CI run of the modified workflow is the first real check of the
    YAML form.

Not in this PR

  • No new CI job, no change to which suites run, no change to Node versions.
  • The two other silent-skip / unguarded-input findings (PyYAML-gated tests/test_isolated_bot_social.py,
    and deploy/isolated/build_manager_release.py having no test or job at all) are separate slices.

Risk and rollback

Metadata and test-only: no product code, no runtime path. Rollback is reverting the two files; the
previous inline ls ... && node --test ... form keeps working unchanged.

The frontend test step ran three node --test inputs behind an ls guard that
listed only .github/scripts/*.test.mjs. node --test exits 0 with zero tests
when a pattern matches no file, so renaming tests/ or the compose planner
file would have left the step green with missing coverage.

List all three inputs before the run, in a block scalar, and make
tests/ci_test_list.test.mjs require the guard and the run line to name
exactly the same inputs: the guard must come first, and neither a missing
guard entry nor an input dropped from the run line may pass.

Related #3440
@github-actions github-actions Bot added the risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff label Nov 29, 2026
@Birfy

Birfy commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator Author

Lead review — slice check for head b78bf7d8d424bd4c3676f03aca654b1092d046b4

Scope: one slice — the frontend ls guard in .github/workflows/tests.yml and its checker in tests/ci_test_list.test.mjs. The guard now has to list exactly the inputs on the node --test line, compared both ways, so a rename, a move, or a dropped input fails the step instead of running a smaller suite and exiting 0. Nothing else in the workflow is touched.

Coordinates (read from this head, not carried over): base main 3f9b8ab06cb6d5f14e458ed411cf24e1281b4f78 (tree 92aff11533e84609e6423ba857cf4bc8d369d057), head tree f3b247f7b4d0bbdd07763ee45f8d9605f2354cc4, 2 files +27/−7 (tests.yml +6/−3, ci_test_list.test.mjs +21/−4). I applied the patch to a fresh unpack of the base tree: git apply --check exit 0, numstat matches the API, and the patched content tree is f3b247f7… — the same tree QA got, so the content binding is independent of the commit sha.

Why the assertion is two-way equality: the first two drafts were fail-open and both were caught before this PR. v1 compared the guard against itself. v2 checked only runArgs ⊆ guardArgs, so deleting tests/*.test.mjs from the node --test line left the guard satisfied while the step ran 150 tests instead of 1117 and exited 0 — the 967-case web block disappeared silently. That case is now the reason for assert.deepEqual on sorted arrays, and it is a named mutation below rather than a comment.

Local readings (this machine, node v22.23.5; not CI):

  • Clean patched tree: tests/ci_test_list.test.mjs 2/2 pass, exit 0.
  • Mutation A, node --test moved before ls: red, the ls guard must come before node --test.
  • Mutation B, an input added to the node --test line: red, the ls guard must list exactly the inputs on the node --test line, diff shows - 'tests/extra.test.mjs'.
  • Mutation C, ls line deleted: red, the block must hold an ls guard and a node --test line.
  • Mutation D, tests/*.test.mjs dropped from the node --test line only: red on the same message, diff shows + 'tests/*.test.mjs'. On the pre-fix v2 assertion this exact mutation was 2/2 pass with 150/150 tests executed and exit 0.
  • The point of the slice, tests/ renamed: step body run as bash -e -x exits 2 with ls: cannot access 'tests/*.test.mjs': No such file or directory; the trace contains that one ls invocation and no node --test call, and the output holds zero TAP summary lines. So the step fails loudly instead of running zero tests.

QA verified the same head independently (local, not CI): apply --check exit 0, patched tree f3b247f7, numstat 2 files +27/−7, 2/2 pass clean, A/B/C/D all red with the messages and diff directions above, and the same renamed-directory result — exit 2, only ls in the trace, no TAP lines. Her control run on the unmodified tree is 1118/1118 pass, 0 fail, 0 cancelled, exit 0 (web 968, scripts 123, planner 27). That count is a single-host reading and is not a stability baseline.

CI on this head (read from the check-runs API, not inferred): total_count 18 == returned 18, all completed + success, every head_sha equal to this head, no failures, no cancellations — including FlyBot required checks, both Management API jobs, Web and compose planner, runtime-image / Build and smoke under the manager contract, both upstream / Upstream suite jobs and browser / screenshots. So this head's CI is green; that is not an acceptance sign-off.

This head goes into the queue only now: when it was first read, three checks were still running (provenance / bot-social-source-tests, runtime-image / Build and smoke, upstream / Upstream suite · Node 22), and the 18/18 reading above is the one taken after they finished as success at 10:30:33Z.

Separately, main 3f9b8ab06cb6d5f14e458ed411cf24e1281b4f78 — the base of this PR — is itself 33/33 completed + success with every head_sha on that commit, so the base this PR is measured against is not carrying a red.

Rules: only Related #3440 is used; the PR body and this comment carry no closing trailer. The risk label was applied by the workflow, not by hand. One reviewable slice only.

Not claimed: that the 1118 count is stable; that this makes the CI step immune to a pattern that matches no file in every other workflow (this slice covers this one step); acceptance sign-off.

Enqueueing this head as b78bf7d8d424bd4c3676f03aca654b1092d046b4.

Related #3440.

@Birfy
Birfy added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 192e72f Nov 29, 2026
18 checks passed
@Birfy
Birfy deleted the dev/3440-ci-ls-guard-all-inputs branch November 29, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant